package com.cskaoyan.until;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.stereotype.Component;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Component
public class Result {
    private Integer errno;
    private String errmsg;
    private Object data;

    public static Result ok() {
        return new Result(0, "成功", null);
    }

    public static Result ok(Object data) {
        return new Result(0, "成功", data);
    }

    public static Result error(Integer errno, String message) {
        return new Result(errno, message, null);
    }
}
